/**
* @file    screen_mipidsi.h
* @brief   screen mipidsi common interface
*
* Copyright (c) 2017 Huawei Tech.Co.,Ltd
*
* @author    HiMobileCam Reference Develop Team
* @date      2017/12/18
* @version   1.0

*/
#ifndef __SCREEN_MIPIDSI__H__
#define __SCREEN_MIPIDSI__H__

#include "hi_mipi_tx.h"
#include "hi_type.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif  /* End of #ifdef __cplusplus */

/** \addtogroup     SCREEN_MIPIDSI */
/** @{ */  /** <!-- [SCREEN_MIPIDSI] */

/**
* @brief          mipi dsi module init
* @return 0     success,non-zero error code.
* @exception   None
* @author       HiMobileCam Reference Develop Team
* @date          2019/07/09
*/
HI_S32 MIPIDSI_Init(HI_VOID);

/**
* @brief          set mipi device config
* @param[in]   devCfg: mipi device config
* @return 0     success,non-zero error code.
* @exception   None
* @author       HiMobileCam Reference Develop Team
* @date          2019/07/09
*/
HI_S32 MIPIDSI_SetDeviceConfig(const combo_dev_cfg_t* devCfg);

/**
* @brief          enable screen to send video data
* @return 0     success,non-zero error code.
* @exception   None
* @author       HiMobileCam Reference Develop Team
* @date          2019/07/09
*/
HI_S32 MIPIDSI_EnableVideoDataTransport(HI_VOID);

/**
* @brief          disable screen to send video data
* @return 0     success,non-zero error code.
* @exception   None
* @author       HiMobileCam Reference Develop Team
* @date          2019/07/09
*/
HI_S32 MIPIDSI_DisableVideoDataTransport(HI_VOID);

/**
* @brief          mipi dsi module deinit
* @return 0     success,non-zero error code.
* @exception   None
* @author       HiMobileCam Reference Develop Team
* @date          2019/07/09
*/
HI_VOID MIPIDSI_Deinit(HI_VOID);

/**
* @brief          use mipi dsi to transport one command
* @param[in]   cmd: command
* @return 0     success,non-zero error code.
* @exception   None
* @author       HiMobileCam Reference Develop Team
* @date          2019/07/09
*/
HI_S32 MIPIDSI_GENERIC_ShortWriteOneParam(HI_U8 cmd);

/**
* @brief          use mipi dsi to transport one command and one data
* @param[in]   cmd: command
* @param[in]   data: data
* @return 0     success,non-zero error code.
* @exception   None
* @author       HiMobileCam Reference Develop Team
* @date          2019/07/09
*/
HI_S32 MIPIDSI_GENERIC_ShortWriteTwoParam(HI_U8 cmd, HI_U8 data);

/**
* @brief          use mipi dsi to transport a long packet with dataCnt's data
* @param[in]   dataCnt: data count
* @param[in]   data: data array, the number is dataCnt
* @return 0     success,non-zero error code.
* @exception   None
* @author       HiMobileCam Reference Develop Team
* @date          2019/07/09
*/
HI_S32 MIPIDSI_GENERIC_LongWrite(HI_U8 dataCnt, const HI_U8* data);

/**
* @brief          read data from cmd
* @param[in]   cmd: read data location
* @param[in]   dataCnt: read data count
* @param[out] data: read data from cmd
* @return 0     success,non-zero error code.
* @exception   None
* @author       HiMobileCam Reference Develop Team
* @date          2019/07/09
*/
HI_S32 MIPIDSI_GENERIC_Read(HI_U8 cmd, HI_U8 dataCnt, HI_U8* data);

/**
* @brief          use mipi dsi to transport one command
* @param[in]   cmd: command
* @return 0     success,non-zero error code.
* @exception   None
* @author       HiMobileCam Reference Develop Team
* @date          2019/07/09
*/
HI_S32 MIPIDSI_DCS_ShortWriteNoParam(HI_U8 cmd);

/**
* @brief          use mipi dsi to transport one command and one data
* @param[in]   cmd: command
* @param[in]   data: data
* @return 0     success,non-zero error code.
* @exception   None
* @author       HiMobileCam Reference Develop Team
* @date          2019/07/09
*/
HI_S32 MIPIDSI_DCS_ShortWriteOneParam(HI_U8 cmd, HI_U8 data);

/**
* @brief          use mipi dsi to transport a long packet with dataCnt's data
* @param[in]   dataCnt: data count
* @param[in]   data: data array, the number is dataCnt
* @return 0     success,non-zero error code.
* @exception   None
* @author       HiMobileCam Reference Develop Team
* @date          2019/07/09
*/
HI_S32 MIPIDSI_DCS_LongWrite(HI_U8 dataCnt, const HI_U8* data);

/**
* @brief          read data from cmd
* @param[in]   cmd: read data location
* @param[in]   dataCnt: read data count
* @param[out] data: read data from cmd
* @return 0     success,non-zero error code.
* @exception   None
* @author       HiMobileCam Reference Develop Team
* @date          2019/07/09
*/
HI_S32 MIPIDSI_DCS_Read(HI_U8 cmd, HI_U8 dataCnt, HI_U8* data);


/** @}*/  /** <!-- ==== SCREEN_MIPIDSI End ====*/

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif  /* End of #ifdef __cplusplus */

#endif /* SCREEN_MIPIDSI  */

